package com.jhs.kjs.dto;

import org.springframework.web.multipart.MultipartFile;

public class BoardPagingDTO extends BoardDTO {
	private final static int unit = 10;

	private int start = 0;
	private int end = 0;
	private int nowSeq = 0;
	private int page = 1;
	private int totalPage = 0;
	private int seq = 0;
	private int searchType;
	private String searchName;
	private String writer;
	private String customerName;
	private String orderBy;
	private String noReViewYn;
	private String mode;
	private MultipartFile attachementFile;
	public int getStart() {
		if (getPage() > 0 && start == 0) {
			return 1 + unit * (getPage() - 1);
		}
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getEnd() {
		if (getPage() > 0 && end == 0) {
			return unit * getPage();
		}
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}

	public int getNowSeq() {
//		ss;
		return nowSeq;
	}

	public void setNowSeq(int nowSeq) {
		this.nowSeq = nowSeq;
		int i = 0;

		for (; unit * i < nowSeq; i++) {
			page = i + 1;
		}
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getSeq() {
		return seq;
	}

	public void setSeq(int seq) {
		this.seq = seq;
	}

	public int getSearchType() {
		return searchType;
	}

	public void setSearchType(int searchType) {
		this.searchType = searchType;
	}

	public String getSearchName() {
		return searchName;
	}

	public void setSearchName(String searchName) {
		this.searchName = searchName;
	}

	public String getWriter() {
		return writer;
	}

	public void setWriter(String writer) {
		this.writer = writer;
	}

	public MultipartFile getAttachementFile() {
		return attachementFile;
	}

	public void setAttachementFile(MultipartFile attachementFile) {
		this.attachementFile = attachementFile;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}

	public String getNoReViewYn() {
		return noReViewYn;
	}

	public void setNoReViewYn(String noReViewYn) {
		this.noReViewYn = noReViewYn;
	}

	public String getMode() {
		return mode;
	}

	public void setMode(String mode) {
		this.mode = mode;
	}
	
}
